package com.pomr.util.page;

import java.util.ArrayList;
import java.util.List;

/**
 * 分页控制
 * @author Administrator
 *
 */
public class Page<T> {
	

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Page(int status, String msg) {
		this.status = status;
		this.msg = msg;
	}

	public Page() {
		
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public T getRows() {
		return rows;
	}

	public void setRows(T rows) {
		this.rows = rows;
	}

	public int getStartData() {
		return (cunrrentPage-1)*pageSize;
	}

	public void setStartData(int startData) {
		this.startData = startData;
	}

	//当前页码  从1开始
    private int cunrrentPage;  
    //全部页码  
    private int totalPage;  
    //全部数据  
    private int total;  
    //每页多少数据  
    private int pageSize;  
    //开始的条数
    private int startData;
    //查询返回结果  
    private T rows;
    //分页链接  
    private String url;  
    
    private int status = 200;//数据状态 200正常
    
    private String msg = "信息获取成功";//状态信息
      
    public String getUrl()  
    {  
        return url;  
    }  
  
    public void setUrl(String url)  
    {  
        this.url = url;  
    }  
  
    public int getCunrrentPage()  
    {  
        return cunrrentPage;  
    }  
  
    public void setCunrrentPage(int cunrrentPage)  
    {  
        if(cunrrentPage<0){  
            cunrrentPage=0;  
        }  
        this.cunrrentPage = cunrrentPage;  
    }  
  
    public int getTotalPage()  
    {  
        return (total+pageSize-1)/pageSize;  
    }  
  
    public void setTotalPage(int totalPage)  
    {  
        if(totalPage<0){  
            totalPage=0;  
        }  
        this.totalPage = totalPage;  
    }  
  
    public int getTotal()  
    {  
        return total;  
    }  
  
    public void setTotal(int totalCount)  
    {  
        if(totalCount<0){  
            totalCount=0;  
        }  
        this.total = totalCount;  
    }  
  
    public int getPageSize()  
    {  
        return pageSize;  
    }  
  
    public void setPageSize(int pageSize)  
    {  
        this.pageSize = pageSize;  
    }  
  
    
}
